package com.draem0507.refactor;

import java.util.Date;
import java.util.List;

/**
 * @title 分解复杂判断
 * @desc
 * @atuh lwx
 * @createtime on 2015/11/14 15:25
 */
public class Day_24 {


    public class Security {
        public List list;

        public Security(List list) {
            this.list = list;
        }

        public boolean HasAccess(Date date, String[] arrs, List<String> exemptions) {
            boolean hasPermission = false;

            if (date != null) {
                if (arrs != null) {
                    if (arrs.length == 0) {
                        if (null != exemptions && exemptions.get(0).equals("abc")) {
                            hasPermission = true;
                        }
                    }
                }
            }

            return hasPermission;
        }
        public boolean HasAccess2(Date date, String[] arrs, List<String> exemptions) {
            boolean hasPermission = false;

            if (date == null||arrs==null) {
                return false;
            }
            if(arrs.length!=0){
                return false;
            }
            if (null != exemptions && exemptions.get(0).equals("abc")) {
                return  true;
            }

            return false;
        }
    }


}
